<template>
      <h2 style="text-align: center;">用户投资赎回列表</h2>
      <table class="table table-striped table-bordered table-hover">
        <thead>
              <tr>
                <td>投资项目编号</td>
                <td>账户名称</td>
                <td>投资项目总金额</td>
                <td>用户已投金额</td>
                <td>赎回金额</td>
              </tr>
        </thead>
         <tbody>
             <tr v-for="item in info">
                <td>{{item.I_Id}}</td>
                <td>{{item.UL_Name}}</td>
                <td>{{item.I_Budget}}</td>
                <td>{{item.UI_Money}}</td>
                <td>{{item.UIR_Money}}</td>
             </tr>
         </tbody>
      </table>
</template>

<script setup lang="ts">
 import {ref,onMounted} from 'vue';

 import axios from 'axios';

 import {useRoute} from 'vue-router';

 const route = useRoute();

 const info = ref([{
    I_Id:0,
    UL_Name:"",
    I_Budget:0,
    UI_Money:0,
    UIR_Money:0
 }])

 onMounted(()=>{
     LoadData();
 })

 const LoadData =()=>{
     axios({
        url:"https://localhost:44337/api/Invests/GetUserInvestRedeemInfo",
        method:"get",
        params:{
            Iid:route.params.Iid
        }
     }).then(res=>{
        console.log(res.data);
        info.value = res.data;
     }).catch(err=>{
         console.log(err);
     })
 }

</script>